package com.xjm.model;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author jaymin<br>
 * 工厂的方式创建Person对象<br>
 * 2020/11/28 0:06
 */
@Component
public class PersonFactory {

	/**
	 * 这个Bean即可以为personC,也可以为Kobe
	 */
	@Bean({"personC", "Kobe"})
	public Person getPerson() {
		return new Person("I am Kobe who created by PersonFactory");
	}
}
